﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;

namespace S3System.ExternalClient
{
    class Program
    {
        static void Main(string[] args)
        {
            try
            {
                var proxy = new S3SystemProxy.S3SystemQueryServiceClient();
                var request = new S3SystemProxy.SearchCustomerRequest();
                var response = proxy.SearchCustomers(request);
                
                foreach (var item in response.Customers)
                {
                    Console.WriteLine(item.FirstName);
                }
            }

            catch (FaultException<S3SystemProxy.S3SystemErrorInfo> ex)
            {
                Console.WriteLine(ex.Detail.UIMessage);                
            }
            

        }
    }
}
